package com.ulife.order.api.response;

import com.ulife.common.gateway.utils.annotation.Description;

import java.io.Serializable;
import java.math.BigDecimal;
import java.text.DecimalFormat;
import java.util.List;

/**
 * Created by Ulife- on 2015/12/30.
 */
@Description("地址信息")
public class ItemInfo  implements Serializable {

    @Description("商品图片地址")
    public String imgUrl;
    @Description("商品ID")
    public long itemId;
    @Description("商品名称")
    public String itemTitle;
    @Description("个数")
    public int quantity;
    @Description("售价")
    public double unitPrice;
    @Description("重量")
    public double weight;
    @Description("是否赠品")
    public boolean isGift;
    @Description("自营/直发")
    public String itemForm;
    @Description("虚拟商品公码")
    public String publicWesen;
    @Description("虚拟商品私码")
    public String privateWesen;
    @Description("优惠券ID")
    public long promoId;
    @Description("商品标签")
    public List<String> tags;

    @Description("发货单号")
    public String shipOrderNo;

    @Description("商品货号")
    public String skuCode;

    @Description("商品ID")
    public  long skuId;

    @Description("单品小计")
    public double subTotal;

    public String getPrivateWesen() {
        return privateWesen;
    }

    public void setPrivateWesen(String privateWesen) {
        this.privateWesen = privateWesen;
    }

    public long getPromoId() {
        return promoId;
    }

    public void setPromoId(long promoId) {
        this.promoId = promoId;
    }

    public String getPublicWesen() {
        return publicWesen;
    }

    public void setPublicWesen(String publicWesen) {
        this.publicWesen = publicWesen;
    }

    public String getImgUrl() {
        return imgUrl;
    }

    public void setImgUrl(String imgUrl) {
        this.imgUrl = imgUrl;
    }

    public long getItemId() {
        return itemId;
    }

    public void setItemId(long itemId) {
        this.itemId = itemId;
    }

    public String getItemTitle() {
        return itemTitle;
    }

    public void setItemTitle(String itemTitle) {
        this.itemTitle = itemTitle;
    }

    public int getQuantity() {
        return quantity;
    }

    public void setQuantity(int quantity) {
        this.quantity = quantity;
    }

    public double getUnitPrice() {
        return formatFloat(unitPrice);
    }

    public void setUnitPrice(double unitPrice) {
        this.unitPrice = unitPrice;
    }

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {
        this.weight = weight;
    }

    public boolean getIsGift() {
        return isGift;
    }

    public void setIsGift(boolean isGift) {
        this.isGift = isGift;
    }

    public String getItemForm() {
        return itemForm;
    }

    public void setItemForm(String itemForm) {
        this.itemForm = itemForm;
    }

    private double formatFloat(double x){
        return   new Double(new DecimalFormat("###0.00").format(x));
    }


    public List<String> getTags() {
        return tags;
    }

    public void setTags(List<String> tags) {
        this.tags = tags;
    }

    public String getShipOrderNo() {
        return shipOrderNo;
    }

    public void setShipOrderNo(String shipOrderNo) {
        this.shipOrderNo = shipOrderNo;
    }

    public String getSkuCode() {
        return skuCode;
    }

    public void setSkuCode(String skuCode) {
        this.skuCode = skuCode;
    }
    public long getSkuId() {
        return skuId;
    }

    public void setSkuId(long skuId) {
        this.skuId = skuId;
    }


    /**
     * 获取单品小计
     * @return
     */
    public double getSubTotal() {
        return subTotal;
    }

    /**
     *
     * @param subTotal
     */
    public void setSubTotal(double subTotal) {
        this.subTotal = subTotal;
    }
}
